import React from 'react'
import { Context } from './App'

export default function Child () {
  return (
    <Context.Consumer>
      {(value) => (
        <div>
          <h3>Child: {value.count}</h3>
          {/* <button onClick={() => changeCount()}>修改爷爷的count</button> */}
          <button onClick={value.changeCount}>修改爷爷的count</button>
        </div>
      )}

    </Context.Consumer>
  )
}
